package priv.stones.number;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/9/22 16:52
 */
public class Math1 {

    public static double round(double number, int scale) {
        return Math.round(number * Math.pow(10, scale)) / Math.pow(10, scale);
    }

    public static void main(String[] args) {
        System.out.println(Math.PI);
        System.out.println(Math.round(10.4562));
        System.out.println(Math.round(10.5562));
        System.out.println(Math.round(-10.5562));
        System.out.println(round(10.4562, 1));
        System.out.println(round(10.4562, 2));
    }

}
